<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,
maximum-scale=1, user-scalable=no">

<link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/css/font-awesome.min.css">
<title>Insert title here</title>
</head>
<body>
	<div class="panel panel-default">
  <!-- 面板头-->
  <div class="panel-heading">
  	<i class="glyphicon glyphicon-th"></i>个人信息表
  </div>
    <!-- 面板体-->
  <div class="panel-body">
  <div class="col-md-8">
	<form action="${pageContext.request.contextPath}/staff/doupdate">
	　　<table class=".table table-striped table-bordered table-hover col-lg-9" style="margin: 20px auto;width:100%">
		  	
		  
	　　<tr>

	　　<td>姓名</td>
	 
	　　<td>

		<input type="hidden" name="staff_id" value="${sessionScope.loginStaff.staff_id}"/>

		<input type="text"  style="width:95%" name="staff_name" readonly="readonly" value="${sessionScope.loginStaff.staff_name}">
		</td>	 
	  	</tr>
	　　<tr>
	 	
	　　<td>性别</td>
	 	
	　　<td><select class="" name="staff_sex">
			<c:if test="${sessionScope.loginStaff.staff_sex=='男'}">
			  <option selected="selected">男</option>
			  <option>女</option>
			  </c:if>
			<c:if test="${sessionScope.loginStaff.staff_sex=='女'}">
			  <option >男</option>
			  <option selected="selected">女</option>
			  </c:if>
			</select>
			
		
	 
	　　<td>手机号码</td>
	 
	　　<td><input type="tel" style="width:95%" name="staff_tele" value="${sessionScope.loginStaff.staff_tele}"></td>
	 
	　　</tr> 
	 
	　　<tr>
	 
	　　<td>家庭住址</td>
	 
	　　<td colspan="3"><input type="text" style="width:98%;" name="staff_address" value="${sessionScope.loginStaff.staff_address}"></td>
	 
	　　</tr>
	 
	　　<tr>
	 
	　　<td colspan="4"align="right">
	 
	　　<button  class="btn btn-info" id="update">提交</button>
		<a  href="${pageContext.request.contextPath}/staff/info" class="btn btn-info" id="cannal" >返回</a>
	　　</td>
	 
	　　</tr>

	　　</table>
	</form>
	<form action="${pageContext.request.contextPath}/staff/uploadimg" id="uploadform" enctype="multipart/form-data" method="post">
		<table class=".table table-striped table-bordered table-hover col-lg-9">
			<tr>
				<td>	
			    	<label for="exampleInputFile">上传头像</label>
			  	</td>
			  	<td>
			  	
			  		<input type="file" id="myheadimg" name="myheadimg" class="trainlogo_sel" accept="image/*" >
			  	</td>
			  	<td>
			  		<input type="button" id="upload" value="上传">
			  	</td>
			  	<td>
			  		<img alt="" src="${pageContext.request.contextPath}/${sessionScope.loginStaff.staff_headimg}" style="width: 100px;height:100px;border-radius:10px">
			  	</td>
			  	
			</tr>
		</table>
		
	</form>
		<form action="${pageContext.request.contextPath}/staff/updatepsw" id="updatepsw"  method="post">
		<table class=".table table-striped table-bordered table-hover col-lg-9">
			<tr>
				<td>	
			    	<label for="exampleInputFile">修改密码</label>
			  	</td>
			  	<td>
			  		
			  		<input type="password" id="password" name="password" class="trainlogo_sel" >
			  	</td>
			  	<td>
			  		<input type="password" id="password" name="newpassword" class="trainlogo_sel" >
			  	</td>
			  	<td>
			  		<input type="button" id="subpsw" value="改密码">
			  	</td>
			  	
			</tr>
		</table>
		
	</form>
	</div>
</div>
</div>
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery-1.12.3.min.js"></script>
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script type="text/javascript">

		$(function(){
		$("#upload").click(
			function(){
				var form=document.getElementById("uploadform")
				if($("#myheadimg").val()==""){
					alert("文件为空，请重新选择")
				}else{
					form.submit();
					alert("头像上传成功")
				}
			}		
		)
	})
</script>
</body>
</html>